# coding: utf-8
from flask_sqlalchemy import SQLAlchemy


db = SQLAlchemy()



class RepairInfo(db.Model):
    __tablename__ = 'repairInfo'

    AutoID = db.Column(db.BigInteger, primary_key=True, info='主键')
    repairID = db.Column(db.BigInteger, nullable=False, index=True, info='报修记录编号')
    repairPlace = db.Column(db.String(255), info='报修地点')
    repairType = db.Column(db.String(50), info='报修类型')
    repairDetail = db.Column(db.String(500), info='报修详细描述')
    contactName = db.Column(db.String(20), info='联系人电话')
    contactPhone = db.Column(db.String(20), info='联系人电话')
    status = db.Column(db.Integer, server_default=db.FetchedValue(), info='维修状态 0是待维修，1是维修中，2是维修结束')
    isDelete = db.Column(db.Integer, server_default=db.FetchedValue())
    userID = db.Column(db.BigInteger, index=True, info='外键，报修记录可以对应一个用户')
    workID = db.Column(db.BigInteger, index=True, info='外键，每个报修记录可以对应一个维修师傅')
    updateTime = db.Column(db.DateTime, info='收到任务正在维修的时间')
    finishTime = db.Column(db.DateTime, info='完成时间')
    createTime = db.Column(db.DateTime, server_default=db.FetchedValue())
